/*########################################################################
	Filename: 	StringUtil.h
	----------------------------------------------------
	Remarks:	�ַ��������������ļ�
	----------------------------------------------------
	Author:		liuwx
	Email:		liuwx9866@163.com

	Created:	11/14/2012 14:09
########################################################################*/
#pragma once
#include <iostream>
#include <string>
#include <vector>
#include <regex>

#define BUF_LEN 512
#pragma warning(disable:4996)


class StringUtil
{
public:
	StringUtil(void);
	~StringUtil(void);


public:
	static CString StringUtil::GetNowTime();
	static int ToWideChar(char * res,wchar_t * des);
	static int ToMulChar(wchar_t * res,char * des);

	static CString GetMoudlePath();

	static wchar_t * ReadIniFile(CString appName,CString key,CString filePath);

	static void WriteIniFile(const CString appName,const CString key,const CString keyValue,const CString iniFilePath);

	static void MidString(char *src, char *dst, int index);
	/*
	*UnicodeToUtf8
	*/
	static std::string UnicodeToUtf8(const wchar_t * wstr);
	/*
	*Ascii2Utf8
	*/
	static std::string Ascii2Utf8(const char* str_c);
	/*
	*UTF8ToUnicode
	*/
	static std::wstring UTF8ToUnicode(const std::string& str);

	/*
	*UTF8ToUnicode
	*/
	static size_t UTF8ToUnicode(char* str_u8, char* str_un);

	static void Stringsplit(const std::string& str, const std::string& split, std::vector<int>& strs);

	static void Stringsplit(const std::string& str, const std::string& split, std::vector<double>& strs);

	static std::string DecToHexStr(int data, int ratio);

	static int FillHexstr(std::string, char *dest, int start, int num);

	static int ByteToDecData(char* pSrc, int nSrcLen);

	static BSTR ConvertToBSTR(const std::string& str);
};
